﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Util.VerificationCode;

namespace DotNetCoreApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class VerificationCodeController : ControllerBase
    {
        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public byte[] Get()
        {
            MemoryStream ms= GenerateCode.CreateCodeImg(GenerateCode.MakeCode());
            return ms.ToArray();
        }
    }
}
